#include <iostream>

class Base
{
public:
    Base()
    {
        std::cout << "Base()" << std::endl;
    }
    ~Base()
    {
        std::cout << "~Base()" << std::endl;
    }
};

class Son : public Base
{
public:
    Son()
    {
        std::cout << "Son()" << std::endl;
    }
    ~Son()
    {
        std::cout << "~Son()" << std::endl;
    }
};

void test01()
{
    // Base b;
    // 子类对象在创建时会先调用父类的构造函数，再调用子类的构造函数
    // 析构顺序与构造顺序相反
    Son s;
}


int main()
{
    test01();
    return 0;
}